﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TdgMaker.DataType
{
    class BaliseTele
    {
        public int Balise_Nr = 0;
        public string Tele_Version = "";
        public string Tele = "";

        public void SetBaliseNr(string s)
        {
            //071-4-07-013-2(T1)
            string[] ss = s.Split('-', '(', ')');
            int a1 = Convert.ToInt32(ss[0], 10);
            int a2 = Convert.ToInt32(ss[1], 10);
            int a3 = Convert.ToInt32(ss[2], 10);
            int a4 = Convert.ToInt32(ss[3], 10);
            int a5 = 1;
            if (ss.Length >= 5)
            {
                a5 = Convert.ToInt32(ss[4], 10);
            }

            int aa = 0;
            aa += a5;
            aa = aa << 7;
            aa += a1;
            aa = aa << 3;
            aa += a2;
            aa = aa << 6;
            aa += a3;
            aa = aa << 8;
            aa += a4;
            this.Balise_Nr = aa;
        }
    }
}
